package _05;

/**
 * Good Question.
 */
public class Solution {
    public static int numberOfFlips(int a, int b) {
	int diff = a ^ b;
	int cnt = 0;
	while (diff != 0) {
	    cnt++;
	    diff &= (diff - 1);
	}
	return cnt;
    }

    public static void main(String... args) {
	int a = 31;
	int b = 14;
	System.out.println(Integer.toHexString(a));
	System.out.println(Integer.toHexString(b));
	System.out.println(numberOfFlips(a, b));
    }
}